# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableMapping, MutableSequence

from google.protobuf import timestamp_pb2  # type: ignore
import proto  # type: ignore

from google.cloud.saasplatform_saasservicemgmt_v1beta1.types import common

__protobuf__ = proto.module(
    package="google.cloud.saasplatform.saasservicemgmt.v1beta1",
    manifest={
        "Location",
        "Saas",
        "Tenant",
        "UnitKind",
        "Unit",
        "UnitDependency",
        "UnitOperation",
        "Provision",
        "Deprovision",
        "Upgrade",
        "Schedule",
        "Release",
        "VariableMapping",
        "FromMapping",
        "ToMapping",
        "Dependency",
    },
)


class Location(proto.Message):
    r"""Location information that the service is available in.

    Attributes:
        name (str):
            Optional. Name of location.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )


class Saas(proto.Message):
    r"""Saas is a representation of a SaaS service managed by the
    Producer.

    Attributes:
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/saas/{saas}".
        locations (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Location]):
            Optional. List of locations that the service
            is available in. Rollout refers to the list to
            generate a rollout plan.
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    locations: MutableSequence["Location"] = proto.RepeatedField(
        proto.MESSAGE,
        number=4,
        message="Location",
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class Tenant(proto.Message):
    r"""Tenant represents the service producer side of an instance of the
    service created based on a request from a consumer. In a typical
    scenario a Tenant has a one-to-one mapping with a resource given out
    to a service consumer.

    Example:

    ::

       tenant:
         name: "projects/svc1/locations/loc/tenants/inst-068afff8"
         consumer_resource: "projects/gshoe/locations/loc/shoes/black-shoe"

    Attributes:
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/tenants/{tenant}".
        consumer_resource (str):
            Optional. Immutable. A reference to the
            consumer resource this SaaS Tenant is
            representing.

            The relationship with a consumer resource can be
            used by SaaS Runtime for retrieving
            consumer-defined settings and policies such as
            maintenance policies (using Unified Maintenance
            Policy API).
        saas (str):
            Required. Immutable. A reference to the Saas
            that defines the product (managed service) that
            the producer wants to manage with SaaS Runtime.
            Part of the SaaS Runtime common data model.
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    consumer_resource: str = proto.Field(
        proto.STRING,
        number=2,
    )
    saas: str = proto.Field(
        proto.STRING,
        number=3,
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class UnitKind(proto.Message):
    r"""Definition of a Unit. Units belonging to the same UnitKind
    are managed together; for example they follow the same release
    model (blueprints, versions etc.) and are typically rolled out
    together.

    Attributes:
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/unitKinds/{unitKind}".
        default_release (str):
            Optional. A reference to the Release object
            to use as default for creating new units of this
            UnitKind (optional).

            If not specified, a new unit must explicitly
            reference which release to use for its creation.
        dependencies (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Dependency]):
            Optional. Immutable. List of other unit kinds
            that this release will depend on. Dependencies
            will be automatically provisioned if not found.
            Maximum 10.
        input_variable_mappings (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.VariableMapping]):
            Optional. List of inputVariables for this
            release that will either be retrieved from a
            dependency’s outputVariables, or will be passed
            on to a dependency’s inputVariables. Maximum
            100.
        output_variable_mappings (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.VariableMapping]):
            Optional. List of outputVariables for this
            unit kind will be passed to this unit's
            outputVariables. Maximum 100.
        saas (str):
            Required. Immutable. A reference to the Saas
            that defines the product (managed service) that
            the producer wants to manage with SaaS Runtime.
            Part of the SaaS Runtime common data model.
            Immutable once set.
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    default_release: str = proto.Field(
        proto.STRING,
        number=2,
    )
    dependencies: MutableSequence["Dependency"] = proto.RepeatedField(
        proto.MESSAGE,
        number=4,
        message="Dependency",
    )
    input_variable_mappings: MutableSequence["VariableMapping"] = proto.RepeatedField(
        proto.MESSAGE,
        number=5,
        message="VariableMapping",
    )
    output_variable_mappings: MutableSequence["VariableMapping"] = proto.RepeatedField(
        proto.MESSAGE,
        number=6,
        message="VariableMapping",
    )
    saas: str = proto.Field(
        proto.STRING,
        number=8,
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class Unit(proto.Message):
    r"""A unit of deployment that has its lifecycle via a CRUD API
    using an actuation engine under the hood (e.g. based on
    Terraform, Helm or a custom implementation provided by a service
    producer). A building block of a SaaS Tenant.

    Attributes:
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/units/{unit}".
        unit_kind (str):
            Optional. Reference to the UnitKind this Unit
            belongs to. Immutable once set.
        release (str):
            Optional. Output only. The current Release
            object for this Unit.
        tenant (str):
            Optional. Reference to the Saas Tenant
            resource this unit belongs to. This for example
            informs the maintenance policies to use for
            scheduling future updates on a unit. (optional
            and immutable once created)
        ongoing_operations (MutableSequence[str]):
            Optional. Output only. List of concurrent
            UnitOperations that are operating on this Unit.
        pending_operations (MutableSequence[str]):
            Optional. Output only. List of pending (wait
            to be executed) UnitOperations for this unit.
        scheduled_operations (MutableSequence[str]):
            Optional. Output only. List of scheduled
            UnitOperations for this unit.
        dependents (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitDependency]):
            Optional. Output only. List of Units that
            depend on this unit. Unit can only be
            deprovisioned if this list is empty. Maximum
            1000.
        dependencies (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitDependency]):
            Optional. Output only. Set of dependencies
            for this unit. Maximum 10.
        input_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Output only. Indicates the current
            input variables deployed by the unit
        output_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Output only. Set of key/value pairs
            corresponding to output variables from execution
            of actuation templates. The variables are
            declared in actuation configs (e.g in helm chart
            or terraform) and the values are fetched and
            returned by the actuation engine upon completion
            of execution.
        maintenance (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Unit.MaintenanceSettings):
            Optional. Captures requested directives for
            performing future maintenance on the unit. This
            includes a request for the unit to skip
            maintenance for a period of time and remain
            pinned to its current release as well as
            controls for postponing maintenance scheduled in
            future.
        state (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Unit.UnitState):
            Optional. Output only. Current lifecycle
            state of the resource (e.g. if it's being
            created or ready to use).
        conditions (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitCondition]):
            Optional. Output only. A set of conditions
            which indicate the various conditions this
            resource can have.
        management_mode (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Unit.ManagementMode):
            Optional. Immutable. Indicates whether the
            Unit life cycle is controlled by the user or by
            the system. Immutable once created.
        system_managed_state (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Unit.SystemManagedState):
            Optional. Output only. Indicates the system
            managed state of the unit.
        system_cleanup_at (google.protobuf.timestamp_pb2.Timestamp):
            Optional. Output only. If set, indicates the
            time when the system will start removing the
            unit.
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    class UnitState(proto.Enum):
        r"""UnitState annotates what is the current state of the unit
        itself.

        Values:
            UNIT_STATE_UNSPECIFIED (0):
                Unspecified state.
            UNIT_STATE_NOT_PROVISIONED (1):
                Unit is not provisioned.
            UNIT_STATE_PROVISIONING (2):
                Unit is being provisioned.
            UNIT_STATE_UPDATING (3):
                Unit is being updated. This is typically when
                a unit is being upgraded to a new release or
                some of the input variables on the Unit is being
                changed. Certain kinds of updates may cause the
                Unit to become unusable while the update is in
                progress.
            UNIT_STATE_DEPROVISIONING (4):
                Unit is being deleted.
            UNIT_STATE_READY (5):
                Unit has been provisioned and is ready for
                use
            UNIT_STATE_ERROR (6):
                Unit has error, when it is not ready and some
                error operation
        """
        UNIT_STATE_UNSPECIFIED = 0
        UNIT_STATE_NOT_PROVISIONED = 1
        UNIT_STATE_PROVISIONING = 2
        UNIT_STATE_UPDATING = 3
        UNIT_STATE_DEPROVISIONING = 4
        UNIT_STATE_READY = 5
        UNIT_STATE_ERROR = 6

    class ManagementMode(proto.Enum):
        r"""ManagementMode describes who is responsible for the
        management of the unit.

        Values:
            MANAGEMENT_MODE_UNSPECIFIED (0):
                No description available.
            MANAGEMENT_MODE_USER (1):
                Unit's lifecycle is managed by the user.
            MANAGEMENT_MODE_SYSTEM (2):
                The system will decide when to deprovision
                and delete the unit. User still can deprovision
                or delete the unit manually.
        """
        MANAGEMENT_MODE_UNSPECIFIED = 0
        MANAGEMENT_MODE_USER = 1
        MANAGEMENT_MODE_SYSTEM = 2

    class SystemManagedState(proto.Enum):
        r"""

        Values:
            SYSTEM_MANAGED_STATE_UNSPECIFIED (0):
                No description available.
            SYSTEM_MANAGED_STATE_ACTIVE (1):
                Unit has dependents attached.
            SYSTEM_MANAGED_STATE_INACTIVE (2):
                Unit has no dependencies attached, but
                attachment is allowed.
            SYSTEM_MANAGED_STATE_DECOMMISSIONED (3):
                Unit has no dependencies attached, and
                attachment is not allowed.
        """
        SYSTEM_MANAGED_STATE_UNSPECIFIED = 0
        SYSTEM_MANAGED_STATE_ACTIVE = 1
        SYSTEM_MANAGED_STATE_INACTIVE = 2
        SYSTEM_MANAGED_STATE_DECOMMISSIONED = 3

    class MaintenanceSettings(proto.Message):
        r"""Captures requested directives for performing future
        maintenance on the unit. This includes a request for the unit to
        skip maintenance for a period of time and remain pinned to its
        current release as well as controls for postponing maintenance
        scheduled in future.

        Attributes:
            pinned_until_time (google.protobuf.timestamp_pb2.Timestamp):
                Optional. If present, it fixes the release on
                the unit until the given time; i.e. changes to
                the release field will be rejected. Rollouts
                should and will also respect this by not
                requesting an upgrade in the first place.
        """

        pinned_until_time: timestamp_pb2.Timestamp = proto.Field(
            proto.MESSAGE,
            number=1,
            message=timestamp_pb2.Timestamp,
        )

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    unit_kind: str = proto.Field(
        proto.STRING,
        number=2,
    )
    release: str = proto.Field(
        proto.STRING,
        number=13,
    )
    tenant: str = proto.Field(
        proto.STRING,
        number=4,
    )
    ongoing_operations: MutableSequence[str] = proto.RepeatedField(
        proto.STRING,
        number=5,
    )
    pending_operations: MutableSequence[str] = proto.RepeatedField(
        proto.STRING,
        number=6,
    )
    scheduled_operations: MutableSequence[str] = proto.RepeatedField(
        proto.STRING,
        number=24,
    )
    dependents: MutableSequence["UnitDependency"] = proto.RepeatedField(
        proto.MESSAGE,
        number=7,
        message="UnitDependency",
    )
    dependencies: MutableSequence["UnitDependency"] = proto.RepeatedField(
        proto.MESSAGE,
        number=8,
        message="UnitDependency",
    )
    input_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=9,
        message=common.UnitVariable,
    )
    output_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=10,
        message=common.UnitVariable,
    )
    maintenance: MaintenanceSettings = proto.Field(
        proto.MESSAGE,
        number=14,
        message=MaintenanceSettings,
    )
    state: UnitState = proto.Field(
        proto.ENUM,
        number=16,
        enum=UnitState,
    )
    conditions: MutableSequence[common.UnitCondition] = proto.RepeatedField(
        proto.MESSAGE,
        number=20,
        message=common.UnitCondition,
    )
    management_mode: ManagementMode = proto.Field(
        proto.ENUM,
        number=22,
        enum=ManagementMode,
    )
    system_managed_state: SystemManagedState = proto.Field(
        proto.ENUM,
        number=25,
        enum=SystemManagedState,
    )
    system_cleanup_at: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=26,
        message=timestamp_pb2.Timestamp,
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class UnitDependency(proto.Message):
    r"""Set of dependencies for this unit. Maximum 10.

    Attributes:
        alias (str):
            Output only. Alias for the name of the
            dependency.
        unit (str):
            Output only. A reference to the Unit object.
    """

    alias: str = proto.Field(
        proto.STRING,
        number=1,
    )
    unit: str = proto.Field(
        proto.STRING,
        number=2,
    )


class UnitOperation(proto.Message):
    r"""UnitOperation encapsulates the intent of changing/interacting
    with the service component represented by the specific Unit.
    Multiple UnitOperations can be created (requested) and scheduled
    in the future, however only one will be allowed to execute at a
    time (that can change in the future for non-mutating
    operations).

    UnitOperations allow different actors interacting with the same
    unit to focus only on the change they have requested.

    This is a base object that contains the common fields in all
    unit operations. Next: 19

    This message has `oneof`_ fields (mutually exclusive fields).
    For each oneof, at most one member field can be set at the same time.
    Setting any member of the oneof automatically clears all other
    members.

    .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

    Attributes:
        provision (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Provision):

            This field is a member of `oneof`_ ``unit_operation_type``.
        upgrade (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Upgrade):

            This field is a member of `oneof`_ ``unit_operation_type``.
        deprovision (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Deprovision):

            This field is a member of `oneof`_ ``unit_operation_type``.
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/unitOperations/{unitOperation}".
        unit (str):
            Required. Immutable. The Unit a given
            UnitOperation will act upon.
        parent_unit_operation (str):
            Optional. Reference to parent resource:
            UnitOperation. If an operation needs to create
            other operations as part of its workflow, each
            of the child operations should have this field
            set to the parent. This can be used for tracing.
            (Optional)
        rollout (str):
            Optional. Specifies which rollout created
            this Unit Operation. This cannot be modified and
            is used for filtering purposes only. If a
            dependent unit and unit operation are created as
            part of another unit operation, they will use
            the same rolloutId.
        cancel (bool):
            Optional. When true, attempt to cancel the
            operation. Cancellation may fail if the
            operation is already executing. (Optional)
        state (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitOperation.UnitOperationState):
            Optional. Output only. UnitOperationState
            describes the current state of the unit
            operation.
        conditions (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitOperationCondition]):
            Optional. Output only. A set of conditions
            which indicate the various conditions this
            resource can have.
        schedule (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Schedule):
            Optional. When to schedule this operation.
        engine_state (str):
            Optional. Output only. The engine state for
            on-going deployment engine operation(s).
            This field is opaque for external usage.
        error_category (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitOperationErrorCategory):
            Optional. Output only.
            UnitOperationErrorCategory describe the error
            category.
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    class UnitOperationState(proto.Enum):
        r"""UnitOperationState describes the current state of the unit
        operation.

        Values:
            UNIT_OPERATION_STATE_UNKNOWN (0):
                No description available.
            UNIT_OPERATION_STATE_PENDING (1):
                Unit operation is accepted but not ready to
                run.
            UNIT_OPERATION_STATE_SCHEDULED (2):
                Unit operation is accepted and scheduled.
            UNIT_OPERATION_STATE_RUNNING (4):
                Unit operation is running.
            UNIT_OPERATION_STATE_SUCCEEDED (5):
                Unit operation has completed successfully.
            UNIT_OPERATION_STATE_FAILED (6):
                Unit operation has failed.
            UNIT_OPERATION_STATE_CANCELLED (7):
                Unit operation was cancelled.
        """
        UNIT_OPERATION_STATE_UNKNOWN = 0
        UNIT_OPERATION_STATE_PENDING = 1
        UNIT_OPERATION_STATE_SCHEDULED = 2
        UNIT_OPERATION_STATE_RUNNING = 4
        UNIT_OPERATION_STATE_SUCCEEDED = 5
        UNIT_OPERATION_STATE_FAILED = 6
        UNIT_OPERATION_STATE_CANCELLED = 7

    provision: "Provision" = proto.Field(
        proto.MESSAGE,
        number=8,
        oneof="unit_operation_type",
        message="Provision",
    )
    upgrade: "Upgrade" = proto.Field(
        proto.MESSAGE,
        number=9,
        oneof="unit_operation_type",
        message="Upgrade",
    )
    deprovision: "Deprovision" = proto.Field(
        proto.MESSAGE,
        number=10,
        oneof="unit_operation_type",
        message="Deprovision",
    )
    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    unit: str = proto.Field(
        proto.STRING,
        number=2,
    )
    parent_unit_operation: str = proto.Field(
        proto.STRING,
        number=3,
    )
    rollout: str = proto.Field(
        proto.STRING,
        number=4,
    )
    cancel: bool = proto.Field(
        proto.BOOL,
        number=5,
    )
    state: UnitOperationState = proto.Field(
        proto.ENUM,
        number=6,
        enum=UnitOperationState,
    )
    conditions: MutableSequence[common.UnitOperationCondition] = proto.RepeatedField(
        proto.MESSAGE,
        number=7,
        message=common.UnitOperationCondition,
    )
    schedule: "Schedule" = proto.Field(
        proto.MESSAGE,
        number=12,
        message="Schedule",
    )
    engine_state: str = proto.Field(
        proto.STRING,
        number=14,
    )
    error_category: common.UnitOperationErrorCategory = proto.Field(
        proto.ENUM,
        number=15,
        enum=common.UnitOperationErrorCategory,
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class Provision(proto.Message):
    r"""Provision is the unit operation that provision the underlying
    resources represented by a Unit. Can only execute if the Unit is
    not currently provisioned.

    Attributes:
        release (str):
            Optional. Reference to the Release object to
            use for the Unit. (optional).
        input_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Set of input variables. Maximum
            100. (optional)
    """

    release: str = proto.Field(
        proto.STRING,
        number=1,
    )
    input_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=3,
        message=common.UnitVariable,
    )


class Deprovision(proto.Message):
    r"""Deprovision is the unit operation that deprovision the
    underlying resources represented by a Unit. Can only execute if
    the Unit is currently provisioned.

    """


class Upgrade(proto.Message):
    r"""Upgrade is the unit operation that upgrades a provisioned
    unit, which may also include the underlying resources
    represented by a Unit. Can only execute if the Unit is currently
    provisioned.

    Attributes:
        release (str):
            Optional. Reference to the Release object to
            use for the Unit. (optional).
        input_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Set of input variables. Maximum
            100. (optional)
    """

    release: str = proto.Field(
        proto.STRING,
        number=1,
    )
    input_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=2,
        message=common.UnitVariable,
    )


class Schedule(proto.Message):
    r"""A time specification to schedule the maintenance.

    Attributes:
        start_time (google.protobuf.timestamp_pb2.Timestamp):
            Optional. Start of operation. If not set,
            will be set to the start of the next window.
            (optional)
    """

    start_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=1,
        message=timestamp_pb2.Timestamp,
    )


class Release(proto.Message):
    r"""A new version to be propagated and deployed to units. This
    includes pointers to packaged blueprints for actuation (e.g Helm
    or Terraform configuration packages) via artifact registry.

    Attributes:
        name (str):
            Identifier. The resource name (full URI of
            the resource) following the standard naming
            scheme:

            "projects/{project}/locations/{location}/releases/{release}".
        unit_kind (str):
            Required. Immutable. Reference to the
            UnitKind this Release corresponds to (required
            and immutable once created).
        blueprint (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Blueprint):
            Optional. Blueprints are OCI Images that
            contain all of the artifacts needed to provision
            a unit.
        release_requirements (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.Release.ReleaseRequirements):
            Optional. Set of requirements to be fulfilled
            on the Unit when using this Release.
        input_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Output only. List of input
            variables declared on the blueprint and can be
            present with their values on the unit spec
        output_variables (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Output only. List of output
            variables declared on the blueprint and can be
            present with their values on the unit status
        input_variable_defaults (MutableSequence[google.cloud.saasplatform_saasservicemgmt_v1beta1.types.UnitVariable]):
            Optional. Mapping of input variables to
            default values. Maximum 100
        labels (MutableMapping[str, str]):
            Optional. The labels on the resource, which
            can be used for categorization. similar to
            Kubernetes resource labels.
        annotations (MutableMapping[str, str]):
            Optional. Annotations is an unstructured
            key-value map stored with a resource that may be
            set by external tools to store and retrieve
            arbitrary metadata. They are not queryable and
            should be preserved when modifying objects.

            More info:
            https://kubernetes.io/docs/user-guide/annotations
        uid (str):
            Output only. The unique identifier of the
            resource. UID is unique in the time and space
            for this resource within the scope of the
            service. It is typically generated by the server
            on successful creation of a resource and must
            not be changed. UID is used to uniquely identify
            resources with resource name reuses. This should
            be a UUID4.
        etag (str):
            Output only. An opaque value that uniquely
            identifies a version or generation of a
            resource. It can be used to confirm that the
            client and server agree on the ordering of a
            resource being written.
        create_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was created.
        update_time (google.protobuf.timestamp_pb2.Timestamp):
            Output only. The timestamp when the resource
            was last updated. Any change to the resource
            made by users must refresh this value. Changes
            to a resource made by the service should refresh
            this value.
    """

    class ReleaseRequirements(proto.Message):
        r"""Set of requirements to be fulfilled on the Unit when using
        this Release.

        Attributes:
            upgradeable_from_releases (MutableSequence[str]):
                Optional. A list of releases from which a
                unit can be upgraded to this one (optional). If
                left empty no constraints will be applied. When
                provided, unit upgrade requests to this release
                will check and enforce this constraint.
        """

        upgradeable_from_releases: MutableSequence[str] = proto.RepeatedField(
            proto.STRING,
            number=1,
        )

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    unit_kind: str = proto.Field(
        proto.STRING,
        number=2,
    )
    blueprint: common.Blueprint = proto.Field(
        proto.MESSAGE,
        number=3,
        message=common.Blueprint,
    )
    release_requirements: ReleaseRequirements = proto.Field(
        proto.MESSAGE,
        number=4,
        message=ReleaseRequirements,
    )
    input_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=5,
        message=common.UnitVariable,
    )
    output_variables: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=6,
        message=common.UnitVariable,
    )
    input_variable_defaults: MutableSequence[common.UnitVariable] = proto.RepeatedField(
        proto.MESSAGE,
        number=7,
        message=common.UnitVariable,
    )
    labels: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10401,
    )
    annotations: MutableMapping[str, str] = proto.MapField(
        proto.STRING,
        proto.STRING,
        number=10402,
    )
    uid: str = proto.Field(
        proto.STRING,
        number=10201,
    )
    etag: str = proto.Field(
        proto.STRING,
        number=10202,
    )
    create_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10303,
        message=timestamp_pb2.Timestamp,
    )
    update_time: timestamp_pb2.Timestamp = proto.Field(
        proto.MESSAGE,
        number=10304,
        message=timestamp_pb2.Timestamp,
    )


class VariableMapping(proto.Message):
    r"""Mapping of input variables to their respective output
    variable for depedenencies

    This message has `oneof`_ fields (mutually exclusive fields).
    For each oneof, at most one member field can be set at the same time.
    Setting any member of the oneof automatically clears all other
    members.

    .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

    Attributes:
        from_ (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.FromMapping):
            Optional. Output variables which will get
            their values from dependencies

            This field is a member of `oneof`_ ``mapping_type``.
        to (google.cloud.saasplatform_saasservicemgmt_v1beta1.types.ToMapping):
            Optional. Input variables whose values will
            be passed on to dependencies.

            This field is a member of `oneof`_ ``mapping_type``.
        variable (str):
            Required. name of the variable
    """

    from_: "FromMapping" = proto.Field(
        proto.MESSAGE,
        number=2,
        oneof="mapping_type",
        message="FromMapping",
    )
    to: "ToMapping" = proto.Field(
        proto.MESSAGE,
        number=3,
        oneof="mapping_type",
        message="ToMapping",
    )
    variable: str = proto.Field(
        proto.STRING,
        number=1,
    )


class FromMapping(proto.Message):
    r"""Output variables whose values will be passed on to
    dependencies

    Attributes:
        dependency (str):
            Required. Alias of the dependency that the
            outputVariable will pass its value to
        output_variable (str):
            Required. Name of the outputVariable on the
            dependency
    """

    dependency: str = proto.Field(
        proto.STRING,
        number=1,
    )
    output_variable: str = proto.Field(
        proto.STRING,
        number=2,
    )


class ToMapping(proto.Message):
    r"""Input variables whose values will be passed on to
    dependencies

    Attributes:
        dependency (str):
            Required. Alias of the dependency that the
            inputVariable will pass its value to
        input_variable (str):
            Required. Name of the inputVariable on the
            dependency
        ignore_for_lookup (bool):
            Optional. Tells SaaS Runtime if this mapping
            should be used during lookup or not
    """

    dependency: str = proto.Field(
        proto.STRING,
        number=1,
    )
    input_variable: str = proto.Field(
        proto.STRING,
        number=2,
    )
    ignore_for_lookup: bool = proto.Field(
        proto.BOOL,
        number=3,
    )


class Dependency(proto.Message):
    r"""Dependency represent a single dependency with another unit
    kind by alias.

    Attributes:
        unit_kind (str):
            Required. Immutable. The unit kind of the
            dependency.
        alias (str):
            Required. An alias for the dependency. Used
            for input variable mapping.
    """

    unit_kind: str = proto.Field(
        proto.STRING,
        number=1,
    )
    alias: str = proto.Field(
        proto.STRING,
        number=2,
    )


__all__ = tuple(sorted(__protobuf__.manifest))
